package com.lyb269.jvm.classLoader;

import org.junit.Test;

/**
 * 类加载文件的路径
 */
public class ClassLoaderFilePathTest {


    @Test
    public void test(){
        //BootstrapLoader 启动类加载器,加载的JVM中最底层的,搜索路径由sun.boot.class.path指定
        System.out.println(System.getProperty("sun.boot.class.path"));
        //打印如下:
        //E:\Java\jdk1.8.0_144\jre\lib\resources.jar;
        //E:\Java\jdk1.8.0_144\jre\lib\rt.jar;
        //E:\Java\jdk1.8.0_144\jre\lib\sunrsasign.jar;
        //E:\Java\jdk1.8.0_144\jre\lib\jsse.jar;
        //E:\Java\jdk1.8.0_144\jre\lib\jce.jar;
        //E:\Java\jdk1.8.0_144\jre\lib\charsets.jar;
        //E:\Java\jdk1.8.0_144\jre\lib\jfr.jar;
        //E:\Java\jdk1.8.0_144\jre\classes



        //ExtClassLoader 扩展类加载器,加载java的一些库,搜索路径由java.ext.dirs指定
        System.out.println(System.getProperty("java.ext.dirs"));
        //打印如下:
        //E:\Java\jdk1.8.0_144\jre\lib\ext;
        //C:\WINDOWS\Sun\Java\lib\ext



        //AppClassLoader 系统类加载器,搜索路径由java.class.path指定
        System.out.println(System.getProperty("java.class.path"));
        //E:\IntelliJ IDEA 2017.2\lib\idea_rt.jar;E:\IntelliJ IDEA 2017.2\plugins\junit\lib\junit-rt.jar;E:\IntelliJ IDEA 2017.2\plugins\junit\lib\junit5-rt.jar;E:\Java\jdk1.8.0_144\jre\lib\charsets.jar;E:\Java\jdk1.8.0_144\jre\lib\deploy.jar;E:\Java\jdk1.8.0_144\jre\lib\ext\access-bridge-64.jar;E:\Java\jdk1.8.0_144\jre\lib\ext\cldrdata.jar;E:\Java\jdk1.8.0_144\jre\lib\ext\dnsns.jar;E:\Java\jdk1.8.0_144\jre\lib\ext\jaccess.jar;E:\Java\jdk1.8.0_144\jre\lib\ext\jfxrt.jar;E:\Java\jdk1.8.0_144\jre\lib\ext\localedata.jar;E:\Java\jdk1.8.0_144\jre\lib\ext\nashorn.jar;E:\Java\jdk1.8.0_144\jre\lib\ext\sunec.jar;E:\Java\jdk1.8.0_144\jre\lib\ext\sunjce_provider.jar;E:\Java\jdk1.8.0_144\jre\lib\ext\sunmscapi.jar;E:\Java\jdk1.8.0_144\jre\lib\ext\sunpkcs11.jar;E:\Java\jdk1.8.0_144\jre\lib\ext\zipfs.jar;E:\Java\jdk1.8.0_144\jre\lib\javaws.jar;E:\Java\jdk1.8.0_144\jre\lib\jce.jar;E:\Java\jdk1.8.0_144\jre\lib\jfr.jar;E:\Java\jdk1.8.0_144\jre\lib\jfxswt.jar;E:\Java\jdk1.8.0_144\jre\lib\jsse.jar;E:\Java\jdk1.8.0_144\jre\lib\management-agent.jar;E:\Java\jdk1.8.0_144\jre\lib\plugin.jar;E:\Java\jdk1.8.0_144\jre\lib\resources.jar;E:\Java\jdk1.8.0_144\jre\lib\rt.jar;E:\tomcat80\lib\jsp-api.jar;E:\IdeaProjects\learning-example\learning-jvm\target\classes;E:\apache-maven-3.5.0\repository\junit\junit\4.13\junit-4.13.jar;E:\apache-maven-3.5.0\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;E:\IntelliJ IDEA 2017.2\lib\idea_rt.jar



        //以上的输出根据各自搭建环境的不同,输出不同

    }
}
